package com.shd.edanpei.util;

import android.content.Context;
import android.support.annotation.DrawableRes;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.shd.edanpei.R;

/**
 * Created by mc on 2018/10/26.
 * yang-wen-wen
 */

public class LayoutUtils {

    public static View getNullLayout(Context context, @DrawableRes int id, String hint) {

        View view = LayoutInflater.from(context).inflate(R.layout.null_layout, null);
        ImageView ivIcon = view.findViewById(R.id.iv_null_icon);
        TextView tvHint = view.findViewById(R.id.tv_null_hint);

        ivIcon.setImageResource(id);
        tvHint.setText(hint);
        return view;
    }
}
